<template>
  <el-card class="admin-info-card">
    <h2>管理员信息</h2>
    <el-descriptions v-if="info" :column="1" border>
      <el-descriptions-item label="ID">{{ info.id }}</el-descriptions-item>
      <el-descriptions-item label="用户名">{{ info.username }}</el-descriptions-item>
      <el-descriptions-item label="角色">{{ info.role }}</el-descriptions-item>
      <el-descriptions-item label="状态">{{ info.status }}</el-descriptions-item>
<!--      <el-descriptions-item label="创建时间">{{ info.createTime }}</el-descriptions-item>-->
    </el-descriptions>
  </el-card>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import axios from '@/utils/axios'
const info = ref(null)
const fetchInfo = async () => {
  const res = await axios.get('/api/user/info')
  info.value = res.data?.user || res.data || res
}
onMounted(fetchInfo)
</script>
<style scoped>
.admin-info-card {
  max-width: 700px;
  margin: 40px auto;
  padding: 30px 20px;
}
</style>
